;; Comprehensive test of all new list procedures

;; Test length
(display "=== Testing length ===")
(newline)
(display "Length of empty list: ")
(display (length '()))
(newline)
(display "Length of (1 2 3): ")
(display (length '(1 2 3)))
(newline)
(newline)

;; Test append
(display "=== Testing append ===")
(newline)
(display "Append with no args: ")
(display (append))
(newline)
(display "Append with one arg: ")
(display (append '(1 2 3)))
(newline)
(display "Append two lists: ")
(display (append '(1 2) '(3 4)))
(newline)
(display "Append three lists: ")
(display (append '(1) '(2 3) '(4 5 6)))
(newline)
(newline)

;; Test reverse
(display "=== Testing reverse ===")
(newline)
(display "Reverse empty list: ")
(display (reverse '()))
(newline)
(display "Reverse (1 2 3): ")
(display (reverse '(1 2 3)))
(newline)
(newline)

;; Test list-tail
(display "=== Testing list-tail ===")
(newline)
(display "List-tail of (1 2 3 4) with k=0: ")
(display (list-tail '(1 2 3 4) 0))
(newline)
(display "List-tail of (1 2 3 4) with k=2: ")
(display (list-tail '(1 2 3 4) 2))
(newline)
(display "List-tail of (1 2 3 4) with k=4: ")
(display (list-tail '(1 2 3 4) 4))
(newline)
(newline)

;; Test list-ref
(display "=== Testing list-ref ===")
(newline)
(display "List-ref of (1 2 3 4) with k=0: ")
(display (list-ref '(1 2 3 4) 0))
(newline)
(display "List-ref of (1 2 3 4) with k=2: ")
(display (list-ref '(1 2 3 4) 2))
(newline)
(newline)

;; Test null? and list?
(display "=== Testing null? and list? ===")
(newline)
(display "null? of '(): ")
(display (null? '()))
(newline)
(display "null? of '(1): ")
(display (null? '(1)))
(newline)
(display "list? of '(): ")
(display (list? '()))
(newline)
(display "list? of '(1 2 3): ")
(display (list? '(1 2 3)))
(newline)
(display "list? of '(1 2 . 3): ")
(display (list? '(1 2 . 3)))
(newline)

(exit)